<? 
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$id=$_POST[id];
$level_id=$_POST[level_id];
$term_id=$_POST[term_id];
$subject_id=$_POST[subject_id];
$teach_id=$_POST[teach_id];
$sql="insert into scheme (id,level_id,term_id,subject_id,teach_id) values('$id','$level_id','$term_id','$subject_id','$teach_id')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=scheme.php'>";
}
if($_GET[MODE]=="DEL")
{
$id=$_GET[id];
$level_id=$_GET[level_id];
$term_id=$_GET[term_id];
$subject_id=$_GET[subject_id];
$teach_id=$_GET[teach_id];
$sql="delete from scheme where id='$id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=scheme.php'>";
}
if($_POST[MODE]=="EDIT")
{
$id=$_POST[id];
$level_id=$_POST[level_id];
$term_id=$_POST[term_id];
$subject_id=$_POST[subject_id];
$teach_id=$_POST[teach_id];
$sql="UPDATE scheme set id='$id',level_id='$level_id',term_id='$term_id',subject_id='$subject_id',teach_id='$teach_id' where id='$id'";
mysql_query($sql) or die(mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=scheme.php'>";
}
?>